﻿avalon.ready(function () {

    $.getJSON("/API/WXAPI.ashx?action=JSSDKGETSIGNAGURE", { "P1": window.location.href }, function (r) {
        if (r.ErrorMsg == "") {

            wx.config({
                debug: false,
                appId: r.Result.appId,
                timestamp: r.Result.timestamp,
                nonceStr: r.Result.noncestr,
                signature: r.Result.signature,
                jsApiList: [
                  'checkJsApi',
                  'onMenuShareTimeline',
                  'onMenuShareAppMessage',
                  'onMenuShareQQ',
                  'onMenuShareWeibo',
                  'hideMenuItems',
                  'showMenuItems',
                  'hideAllNonBaseMenuItem',
                  'showAllNonBaseMenuItem',
                  'translateVoice',
                  'startRecord',
                  'stopRecord',
                  'onRecordEnd',
                  'playVoice',
                  'pauseVoice',
                  'stopVoice',
                  'uploadVoice',
                  'downloadVoice',
                  'chooseImage',
                  'previewImage',
                  'uploadImage',
                  'downloadImage',
                  'getNetworkType',
                  'openLocation',
                  'getLocation',
                  'hideOptionMenu',
                  'showOptionMenu',
                  'closeWindow',
                  'scanQRCode',
                  'chooseWXPay',
                  'openProductSpecificView',
                  'addCard',
                  'chooseCard',
                  'openCard'
                ]
            });
            wx.ready(function(){
                wx.hideOptionMenu();
            }
           

            //$(".ui-icon-add").click(function () {

            //    wx.chooseImage({
            //        success: function (res) {
            //            images.localId = res.localIds;
            //            alert('已选择 ' + res.localIds.length + ' 张图片');
            //        }
            //    });
            //})

        } else {

        }

    })



})

